package com.kg.elysia.db;

import io.vertx.core.json.JsonObject;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 壁画信息实体类
 * </p>
 *
 * @author zj
 * @since 2025/10/20 14:46
 */
@Data
public class Mural {


    /**
     * 主键ID，自增
     */
    private Integer id;

    /**
     * 墓葬名称
     */
    private String tombName;

    /**
     * 壁画位置
     */
    private String muralPosition;

    /**
     * 资料出处
     */
    private String reference;

    /**
     * 性别
     */
    private String gender;

    /**
     * 身份
     */
    private String identity;

    /**
     * 角色场景
     */
    private String scene;

    /**
     * 上装
     */
    private String upperGarment;

    /**
     * 下装
     */
    private String lowerGarment;

    /**
     * 配饰
     */
    private String accessory;

    /**
     * 鞋靴
     */
    private String shoes;

    /**
     * 色彩
     */
    private String color;

    /**
     * 纹样
     */
    private String pattern;

    /**
     * 时期
     */
    private String period;

    /**
     * 朝代
     */
    private String dynasty;

    /**
     * 制度规范
     */
    private String institution;

    /**
     * 文化风尚
     */
    private String culture;

    /**
     * 阶级属性
     */
    private String socialClass;

    /**
     * 宗教象征
     */
    private String religion;

    public JsonObject toJson() {
        return new JsonObject()
                .put("id", id)
                .put("tomb_name", tombName)
                .put("mural_position", muralPosition)
                .put("reference", reference)
                .put("gender", gender)
                .put("identity", identity)
                .put("scene", scene)
                .put("upper_garment", upperGarment)
                .put("lower_garment", lowerGarment)
                .put("accessory", accessory)
                .put("shoes", shoes)
                .put("color", color)
                .put("pattern", pattern)
                .put("period", period)
                .put("dynasty", dynasty)
                .put("institution", institution)
                .put("culture", culture)
                .put("social_class", socialClass)
                .put("religion", religion);
    }

    public Map<String, Object> toMap() {
        Map<String,Object> map = new HashMap<>();
        map.put("tomb_name", tombName);
        map.put("mural_position", muralPosition);
        map.put("reference", reference);
        map.put("gender", gender);
        map.put("identity", identity);
        map.put("scene", scene);
        map.put("upper_garment", upperGarment);
        map.put("lower_garment", lowerGarment);
        map.put("accessory", accessory);
        map.put("shoes", shoes);
        map.put("color", color);
        map.put("pattern", pattern);
        map.put("period", period);
        map.put("dynasty", dynasty);
        map.put("institution", institution);
        map.put("culture", culture);
        map.put("social_class", socialClass);
        map.put("religion", religion);
        return map;
    }

    public Mural(JsonObject json) {
        this.id = json.getInteger("id");
        this.tombName = json.getString("tomb_name");
        this.muralPosition = json.getString("mural_position");
        this.reference = json.getString("reference");
        this.gender = json.getString("gender");
        this.identity = json.getString("identity");
        this.scene = json.getString("scene");
        this.upperGarment = json.getString("upper_garment");
        this.lowerGarment = json.getString("lower_garment");
        this.accessory = json.getString("accessory");
        this.shoes = json.getString("shoes");
        this.color = json.getString("color");
        this.pattern = json.getString("pattern");
        this.period = json.getString("period");
        this.dynasty = json.getString("dynasty");
        this.institution = json.getString("institution");
        this.culture = json.getString("culture");
        this.socialClass = json.getString("social_class");
        this.religion = json.getString("religion");
    }

    public String toContent() {
        return String.format("墓葬名称：%s;壁画位置：%s;资料出处：%s;性别：%s;身份：%s;角色场景：%s;上装：%s;下装：%s;配饰：%s;鞋靴：%s;色彩：%s;纹样：%s;时期：%s;朝代：%s;制度规范：%s;文化风尚：%s;阶级属性：%s;宗教象征：%s \n",
                tombName, muralPosition, reference, gender, identity, scene,
                upperGarment, lowerGarment, accessory, shoes, color, pattern,
                period, dynasty, institution, culture, socialClass, religion);
    }

    public Mural() {}
}
